// components/official-account/index.js
import Notify from "@vant/weapp/notify/notify";
import {getStorageSync, setStorage} from "../../utils/Storage";
import Config from "../../main.config";
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    ready: function() {
        this.checkTips();
    },

    /**
     * 组件的方法列表
     */
    methods: {
        checkTips: function () {
            let officialAccount = getStorageSync(Config.storage.officialAccount);
            if (officialAccount) return false;
            Notify({
                type: "success",
                message: "关注公众号，及时接收消息！",
                duration: 3000,
                selector: "#account-selector",
                context: this
            });
            setStorage(Config.storage.officialAccount, true)
        }
    }
})
